package com.bjsxt.chapter12_chainOfResponsibility;

/**
 * @ClassName Manager
 * @Description 经理
 * @Author 黑马程序员
 * @Date 10:43 2024/6/23
 * @Version 1.0
 **/
public class Manager extends Leader{

    public Manager(String name) {
        super(name);
    }


    @Override
    public void handler(LeaveRequest req) {
        System.out.println("员工: " + req.getEmpName() + ",请假天数: " + req.getLeaveDays() + "天,请假理由: " + req.getReason());
        if (req.getLeaveDays() < 10){
            System.out.println("经理: " + name + ",审批通过!");
        } else{
            System.out.println("经理: " + name + ",权限不足，请示上级领导: "+this.nextLeader.name+"副总经理!");
            if (this.nextLeader != null){
                this.nextLeader.handler(req);
            }
        }
    }
}
